<?php

namespace apiend\modules\h5\models;

use Yii;
use common\helpers\Url;

/**
 * 学校快速检索模型
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class SchoolSearch extends \common\models\school\School {

    public function fields() {
        return [
            'id',
            'name',
            'grade',
            'cover' => function () {
                return Url::toRemote($this->cover);
            },
            'region',
            'address_detail',
            'followed',
            'telephone',
            'description' => function () {
                if ($this->data) {
                    return $this->data->content;
                }
                return '暂无学校简介内容';
            },
        ];
    }

}
